﻿
#include "SerialDebugger.h"
#include <QDate>
#include <QDateTime>

SerialDebugger::SerialDebugger(const QString & file_name,QObject *parent)
    : QObject{parent}
{
    enableSaveLogToFile(true);
}

bool SerialDebugger::enableSaveLogToFile(bool enable)
{
    this->isEnableSaveTofile_ = enable;
    QDateTime currentDateTime = QDateTime::currentDateTime();
    QString dataString = currentDateTime.toString("yyyy-MM-dd hh:mm:ss");
    QString formatString = QString("[%1#recv]").arg(dataString);
    return false;
}

void SerialDebugger::recvSerialMsg(LinkInterface* link,const QByteArray bytes)
{
    if(isEnableSaveTofile_){
       //写入到文件//
    } 
}
